home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / screen.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  2KB  |  74 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. /* screen.c */
  21.  
  22. #include "externs.h"
  23.  
  24.  
  25.  
  26. void AVL_FIX_SCREEN()
  27. {
  28.     AVL_EDIT_WINDOW_PTR w;
  29.     AVL_LINE_PTR l, l1;
  30.     struct rccoord old;
  31.     int i, j, r, c, c2;
  32.     short att;
  33.     old = _gettextposition();
  34.     _settextrows( 25 );
  35.     _clearscreen( _GCLEARSCREEN );
  36.     w = &avl_windows[avl_window];
  37.     l = l1 = w -> current_line;
  38.     j = old.row;
  39.     r = w -> scr_row;
  40.     c = w -> txt_col;
  41.     c2 = w -> scr_col;
  42.     while (j > 1 && l -> line_no > 0)  {
  43.         l = l -> previous;
  44.         --j;
  45.         }
  46.     w -> txt_col = 0;
  47.     for (i = 1; i <= (w -> r2 - w -> r1 + 1) && l != w -> head; ++i)  {
  48.         _settextposition(i,1);
  49.         w -> scr_row = i;
  50.         w -> current_line = l;
  51.         AVL_UPDATE_LINE();
  52.         l = l -> next;
  53.         }
  54.     w -> scr_row = r;
  55.     w -> txt_col = c;
  56.     w -> scr_col = c2;
  57.     _settextposition(old.row,old.col);
  58.     w -> current_line = l1;
  59. }        
  60.                 
  61.  
  62.  
  63. void AVL_UPDATE_SCREEN()
  64. {
  65.     short att;
  66.     att = _settextcursor(0x2000);
  67. /*   _settextwindow(w -> r1, w -> c1, w -> r2, w -> c2);
  68. */
  69.     AVL_FIX_SCREEN();
  70.     AVL_UPDATE_CURSOR();
  71.     att = _settextcursor(att);
  72. }
  73.  
  74.